1. Field of the Invention
The present invention relates to an apparatus and a method for stereoscopic image processing. More particularly, it is concerned with a process of filtering parallaxes calculated from stereoscopic images.
2. Description of the Related Art
Considerable attention is given in recent years to a vehicle monitoring apparatus which obtains information (preview information) on views ahead of own vehicle using a stereo camera apparatus and controls the vehicle based on this information. As an example, a stereo type vehicle monitoring apparatus calculates a positional deviation (parallax) of a common object on a pair of photographed images (stereo matching) The apparatus determines the distance to the object based on the calculated parallax using the principle of triangulation. Then, using also image recognition technology, the apparatus recognizes the distance to a running vehicle or other objects ahead of own vehicle or road shapes.
Various three-dimensional objects exist outside own vehicle, and in many cases a plurality of similar objects could be shown on the photographed image. A row of traffic cones, road lamps and electric poles are typical examples of similar-looking three-dimensional objects. Stereo matching performed based on stereoscopic images in which a plurality of look-alike three-dimensional objects are shown tends to mismatch, and therefore there is a possibility that wrong parallaxes may be calculated.
This invention has been made in consideration of the aforementioned circumstances. Accordingly, an object of the present invention is to provide an apparatus and a method for stereoscopic image processing which remove wrong parallaxes by filtering operation if the wrong parallaxes have been calculated due to a mismatch in the stereo matching under such conditions that a plurality of look-alike three-dimensional objects are present.
Another object of the present invention is to prevent deterioration of reliability of distance information by removing erroneously calculated parallaxes.
The objects can be achieved by a stereoscopic image processing apparatus comprising: a first image producing unit; a second image producing unit; a stereo matching unit; and a filter. The first image producing unit produces a first photographed image of an object scene. The second image producing unit produces a second photographed image of the object scene. The stereo matching unit identifies within the second photographed image a correlated destination of each pixel block in first photographed image by searching along the same horizontal line as the pixel block of the first photographed image and calculates a parallax of the pixel block based on a deviation between a position of the pixel block of the first photographed image and a position of the correlated destination. The filter judges the smallest parallax in the parallaxes of the plural pixel blocks as a valid parallax when plural pixel blocks located on the same horizontal line in the first photographed image have the same correlated destination in the second photographed image.
In the stereoscopic image processing apparatus of the invention, it is preferable that the filter judges the parallax, which has not been judged as the valid parallax, as valid parallax, if it has a value smaller than a predetermined value.
The above-mentioned objects can be achieved by a stereoscopic image processing method comprising:
producing a first photographed image of an object scene;
producing a second photographed image of the object scene;
identifying within the second photographed image a correlated destination of each pixel block in first photographed image by searching along the same horizontal line as the pixel block of the first photographed image;
calculating a parallax of the pixel block based on a deviation between a position of the pixel block of the first photographed image and a position of the correlated destination; and
judging, when plural pixel blocks located on the same horizontal line in first photographed image have the same correlated destination in the second photographed image, the smallest parallax in the parallaxes of the plural pixel blocks as a valid parallax.
In the stereoscopic image processing method of the invention, it is preferable that the step of judging the parallax having the smallest value judges the parallax, which has not been judged as the valid parallax, as a valid parallax if it has a value smaller than a predetermined value.
The stereoscopic image processing method of the invention preferably further comprises: counting the number of parallaxes which have not been judged as the valid parallax.
Further, the above-mentioned objects can be achieved by a stereoscopic image processing apparatus comprising: a first image producing unit; a second image producing unit; a stereo matching unit; and a filter. The first image producing unit produces a first photographed image of an object scene. The second image producing unit produces a second photographed image of the object scene. The stereo matching unit identifies within the second photographed image a correlated destination of each pixel block in first photographed image by searching along the same horizontal line as the pixel block of the first photographed image and calculates a parallax of the pixel block based on a deviation between a position of the pixel block of the first photographed image and a position of the correlated destination. The filter judges parallaxes each of which has a value smaller than a predetermined value as valid parallaxes, when plural pixel blocks located on the same horizontal line in the first photographed image have the same correlated destination in the second photographed image.
In the stereoscopic image processing apparatus of the invention, it is preferable that the filter judges the smallest parallax in the parallaxes, which have been judged as the valid parallaxes, as a valid parallax.